<div id="event">
    <input type="hidden" id="statusTime" value="<?=$this->statusTime?>"/>
    <input type="hidden" id="eventid" value="<?=$this->eventid?>"/>
    <div class="participants">
        <?php $pos = 0;
        foreach ($this->event["ps"] as $p):?>
            <? if ($pos == $this->timerpos):?>
             <div class="time">
                 <?if($this->finished):?>
                    <div><span id="label_finished">Finished</span></div>
                 <?else:?>
                     <input type="hidden" id="seconds"value="<?=$this->time?>">
                     <input type="hidden" id="part"value="<?=($this->part-1)?>">
                     <div><span id="label_part"><?=$this->part;?></span>ª parte<br /><span id="label_time"><?="min ".((int)($this->time/60));?></span></div>
                 <?endif;?>
            </div>
            <?endif; ?>
            <div class="participant">
                <div class="name"><?=$p["n"];?></div>
                <div class="score" id="score<?=$pos?>"><?=$p["s"];?></div>
            </div>
            <?$pos++;
        endforeach;?>
    </div>
    <?if ($this->editable):?>
        <div id="edit-actions">
            <? for ($i=0;$i<=1;$i++):?>
                <div class="panel-actions">
                    <? foreach($this->sport['actions'] as $key=>$action):?>
                    <input type="button" class="btn_action" value="<?=$action['name']?>" id="<?=$i."_".$key?>"/>
                    <?endforeach;?>
                    
                </div>
                <?if($i==0):?>
                    <div id="panel-time">
                        
                        <!--<input type="button" class="btnStart" <?=($this->statusTime==0  || ($this->statusTime%2==0 && $this->statusTime%4!=0))?'disabled="disabled"':''?> value="<?=($this->statusTime>0 && ($this->statusTime%3==0 || ($this->statusTime%2==0 && $this->statusTime%4!=0)))?'end':'start'?>" />-->
                        <?if (!$this->finished):?>
                            <input type="button" class="btnStart" value="start">
                            <?if($this->statusTime>1 && $this->statusTime%3==0):?>
                                <input type="button" class="btnEnd" value="end" />
                            <?else:?>
                                <input style="display:none" type="button" class="btnEnd" value="end" />
                            <?endif;?>
                        <?endif;?>
                    </div>
                    <?endif;?>
            <?endfor;?>

        </div>
    <?endif;?>
    <div class="actions">
        <?php 
        if(is_array($this->actions)):
        $part=$this->part-1;
        foreach ($this->actions as $a):?>
        <div class="action">
            <? if($a['t']=="0") :?>
                <p><b>Fin de la parte nº <?=$part--?></b></p>
            <?else:?>
                <p><?="min ".((int)($a["t"]/60)).": ".$this->sport["actions"]["action_".$a["a"]]["name"]." de ".$this->event["ps"][$a["p"]]['n'];?></p>
            <?endif;?>
        </div>
        <?endforeach;
        endif;?>
    </div>
</div>